package dfbz.com.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class StrUtil {


    public static boolean checkEmail(String email){

        if (null == email || "".equals(email)){
            return false;
        }
        String reqExl = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
        Pattern p = Pattern.compile(reqExl);
        Matcher m = p.matcher(email);
        return m.matches();
    }


    public static String creatRandomNum() {
        double random = Math.random();
        int num = (int) ((random*9+1)*100000);

        return num + "";
    }
}
